using System;
using System.Collections.Generic;
using System.Text;
using LiveStock.dataAccess;
using LiveStock.RssObjects;
using System.Xml;

namespace LiveStock.Evaluation
{
    class BloggingStocksEvaluation : IEvaluation
    {
        public BloggingStocksEvaluation() { }

        public List<NewsItem> getNewsItems(string stockSymbol)
        {
            List<NewsItem> theNewsItemList = new List<NewsItem>();
            EvaluationSources.EvaluationSourcesDataTable blogSourcesDataTable = EvaluationSourcesData.EvaluationSourceGetByName("BloggingStocks");
            if (blogSourcesDataTable.Rows.Count > 0)
            {
                NewsItemRssReader.FillNewsItemList(theNewsItemList, blogSourcesDataTable[0].URL.Replace("http://", "http://" + stockSymbol + "."),
                    blogSourcesDataTable[0].EvaluationSourceID);
            }

            return theNewsItemList;
        }
    }
}
